//
//  LcRequestMeta.m
//  18Birdies
//
//  Created by Lc on 15/3/24.
//  Copyright (c) 2015年 Lc. All rights reserved.
//

#import "LcPreconditions.h"
#import "LcRequestMeta.h"

@implementation LcRequestMeta

- (instancetype)initWithPath:(NSString*)path
              encryptionType:(LcRequestEncryptionType)encryptionType
             requestDataType:(NSString*)requestDataType
            responseDataType:(NSString*)responseDataType {
  self = [super init];
  if (self) {
    _path = path.copy;
    _encryptionType = encryptionType;
    _requestDataType = requestDataType;
    _responseDataType = responseDataType;
  }
  return self;
}

+ (LcRequestMeta*)requestMetaWithPath:(NSString*)path
                       encryptionType:(LcRequestEncryptionType)encryptionType
                      requestDataType:(NSString*)requestDataType
                     responseDataType:(NSString*)responseDataType {
  LC_CHECK_NOT_EMPTY(path);
  LC_CHECK_NOT_EMPTY(requestDataType);
  LC_CHECK_NOT_EMPTY(responseDataType);
  return [[self alloc] initWithPath:path
                     encryptionType:encryptionType
                    requestDataType:requestDataType
                   responseDataType:responseDataType];
}

@end
